/*
 * pi3's Linux kernel Runtime Guard
 *
 * Component:
 *  - Intercept 'ovl_create_or_link' function
 *
 * Notes:
 *  - We are maintianing Red-Black tree of pid's for Exploit Detection feature.
 *    When process calls 'ovl_create_or_link', we need to correctly handle
 *    this situation and adjust 'off' flag
 *
 * Caveats:
 *  - None
 *
 * Timeline:
 *  - Created: 28.III.2019
 *
 * Author:
 *  - Adam 'pi3' Zabrocki (http://pi3.com.pl)
 *
 */

#ifndef P_LKRG_EXPLOIT_DETECTION_OVL_CREATE_OR_LINK_H
#define P_LKRG_EXPLOIT_DETECTION_OVL_CREATE_OR_LINK_H

/* per-instance private data */
struct p_ovl_create_or_link_data {
    ktime_t entry_stamp;
};

extern char p_ovl_create_or_link_kretprobe_state;

int p_ovl_create_or_link_ret(struct kretprobe_instance *ri, struct pt_regs *p_regs);
int p_ovl_create_or_link_entry(struct kretprobe_instance *p_ri, struct pt_regs *p_regs);
int p_install_ovl_create_or_link_hook(int p_isra);
void p_uninstall_ovl_create_or_link_hook(void);
void p_reinit_ovl_create_or_link_kretprobe(void);

#endif
